namespace Digitalmes.Common.ChannelQueues;

public static class ChannelQueueSetup
{
    /// <summary>
    /// 注册基于 <see cref="Channel{}"/> 的消息队列服务。
    /// </summary>
    /// <param name="services"></param>
    /// <returns></returns>
    public static IServiceCollection AddMessageQueueSetup(this IServiceCollection services)
    {
        services.AddSingleton(typeof(IChannelQueueTiny<>), typeof(ChannelQueueTiny<>));
        services.AddSingleton(typeof(IChannelQueueSmall<>), typeof(ChannelQueueSmall<>));
        services.AddSingleton(typeof(IChannelQueueMedium<>), typeof(ChannelQueueMedium<>));

        return services;
    }
}
